package kasgroup2;

import java.util.ArrayList;

abstract class Person {

    private String name;
    private String address;
    private String city;
    private String country;
    private String firmName;
    private String phoneNumberHome;
    private String phoneNumberFirm;
    private ArrayList<HotelRoomGuest> hotelRooms;
    
    public Person() {
        
    }
    
    public Person(
                    String p_Name, 
                    String p_Address, 
                    String p_City, 
                    String p_Country, 
                    String p_FirmName, 
                    String p_PhoneFirm, 
                    String p_PhoneHome) {
        this.name = p_Name;
        this.address = p_Address;
        this.city = p_City;
        this.country = p_Country;
        this.firmName = p_FirmName;
        this.phoneNumberFirm = p_PhoneFirm;
        this.phoneNumberHome = p_PhoneHome;
        this.hotelRooms = new ArrayList<HotelRoomGuest>();
    }

    public String getName() {
        return name;
    }

    public String getAddress() {
        return address;
    }

    public String getCity() {
        return city;
    }

    public String getCountry() {
        return country;
    }

    public String getFirmName() {
        return firmName;
    }

    public String getPhoneNumberHome() {
        return phoneNumberHome;
    }

    public String getPhoneNumberFirm() {
        return phoneNumberFirm;
    }
    
    public ArrayList<HotelRoomGuest> getHotelRooms() {
        return hotelRooms;
    }
    
    public static Boolean IsParticipant(Person p_Person) {
        if (p_Person.getClass().equals(Participant.class)) {
            return true;
        }
        return false;
    }
    
    public static Boolean IsCompanion(Person p_Person) {
        if (p_Person.getClass().equals(Companion.class)) {
            return true;
        }
        return false;
    }
    
    public static Boolean IsSpeaker(Person p_Person) {
        if (p_Person.getClass().equals(Speaker.class)) {
            return true;
        }
        return false;
    }
    
    public void addHotelRoom(Hotel h, Room r, int amount) {
        this.hotelRooms.add(new HotelRoomGuest(h, r, amount));
    }

    public void addHotelRooms(ArrayList<HotelRoomGuest> p_HotelRooms) {
        this.hotelRooms = p_HotelRooms;
        for(HotelRoomGuest hrg : hotelRooms) {
            System.out.println(
                    "name: " + hrg.getHotel().getName() +
                    " type: " +hrg.getRoom().getRoomType() +
                    " price: " + hrg.getRoom().getRoomTotalPrice() +
                    " amount: " + hrg.getAmount()
                    );
        }
    }
}